<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子23-JS进阶（三）</title>
    </head>
    <body>
        <pre>
            <code>
                    // 例子23

                    var quote = /"([^"]*)"/g; // 将一个字符串中的英文引号替换为中文半角引号,中间内容区域不能含引号
                    var text = '"Javascript is fun"'
                    text.replace(quote, '“$1”'); // "“Javascript is fun”"
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/23.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>
</html>